﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LunarSF.SHomeWorkshop.LunarMarkdownEditor;

namespace LunarSF.SHomeWorkshop.LunarMarkdownEditor
{
    public class TableColumnDefinition
    {
        public ColumnDefinition Align { get; set; }

        private int maxTextWidth = 3;

        public int MaxTextWidth
        {
            get
            {
                switch (Align)
                {
                    case ColumnDefinition.LEFT:
                    case ColumnDefinition.RIGHT:
                        {
                            return Math.Max(this.maxTextWidth, 2);//考虑到列定义的需要，每个单元格最小也需要2或3的宽度。:-或者-:
                        }
                    default:
                        {
                            return Math.Max(this.maxTextWidth, 3);//考虑到列定义的需要，每个单元格最小也需要2或3的宽度。:-:
                        }
                }
            }
            set
            {
                this.maxTextWidth = value;
            }
        }

        private int? startNumber = null;

        public int? StartNumber
        {
            get { return startNumber; }
            set { startNumber = value; }
        }
    }
}
